<?php

use think\migration\Migrator;
use think\migration\db\Column;

class ControlSettingIndustryMonitorAnalysis extends Migrator
{
    /**
     * 管控 - 设置 - 工况分析
     */
    public function change()
    {
        $table = $this->table('control_setting_industry_monitor_analysis');
        $table
            //step1:污染物名称
            ->addColumn('type', 'string', ['limit' => 50, 'comment'=>'污染物类型:SO2,NOX',])

            //step2:相关管控ID
            ->addColumn('plan_id', 'integer', ['limit' => 4, 'comment'=>'管控预案的ID',])

            //step3:列表中相关ID
            ->addColumn('company_id', 'integer', ['limit' => 11, 'comment'=>'超标的企业的ID',])
            ->addColumn('drain_id', 'integer', ['limit' => 11, 'comment'=>'排口ID',])
            ->addColumn('drain_name', 'integer', ['limit' => 11, 'comment'=>'排口名称',])
            //运行浓度
            ->addColumn('operation_concentration', 'integer', ['limit' => 11, 'comment'=>'运行浓度',])
            //运行效率
            ->addColumn('operating_efficiency', 'integer', ['limit' => 11, 'comment'=>'运行效率',])
            //排放量
            ->addColumn('contribution_degree', 'string', ['limit' => 20, 'comment'=>'排放量',])
            //贡献度
            ->addColumn('contribution_value', 'string', ['limit' => 20, 'comment'=>'贡献度',])

            //step4:相关其他ID
            ->addColumn('industry_id', 'integer', ['limit' => 4, 'comment'=>'行业ID',])
            ->addColumn('region_id', 'integer', ['limit' => 4, 'comment'=>'区域ID',])

            //插入时间
            ->addColumn('create_time', 'integer', ['limit' => 11, 'comment'=>'插入时间',])
            ->addColumn('control_status', 'integer', ['limit' => 2, 'comment'=>'1在管控状态0不在管控状态中',])
            ->addColumn('update_time', 'integer', ['limit' => 11, 'comment'=>'修改时间',])

            //注释
            ->setComment('管控 - 目标列表')

            //引擎
            ->setEngine('InnoDB')
            ->save();
    }
}
